﻿using System;
using System.Xml.Linq;

namespace HigLabo.Net.Twitter
{
    /// <summary>
    /// 
    /// </summary>
    public partial class TwitterClient
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="callback"></param>
        public void GetAccountSettings(Action<AccountSettings> callback)
        {
            this.GetResultText(TwitterApiUrl.Version1_1.Accounts.GetAccountSettingsUrl
                , json => callback(new AccountSettings(json)));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="includeEntities"></param>
        /// <param name="skipStatus"></param>
        /// <param name="callback"></param>
        public void GetAccountVerifyCredentials(Boolean includeEntities, Boolean skipStatus, Action<User> callback)
        {
            var command = new GetAccountVerifyCredentialsCommand();
            command.IncludeEntities = includeEntities;
            command.SkipStatus = skipStatus;
            this.GetAccountVerifyCredentials(command, callback);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <param name="callback"></param>
        public void GetAccountVerifyCredentials(GetAccountVerifyCredentialsCommand command, Action<User> callback)
        {
            this.GetResultText(TwitterApiUrl.Version1_1.Accounts.GetAccountVerifyCredentialsUrl, command
                , json => callback(new User(json)));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <param name="callback"></param>
        public void UpdateAccountSettings(UpdateAccountSettingsCommand command, Action<AccountSettings> callback)
        {
            this.GetResultText(HttpMethodName.Post, TwitterApiUrl.Version1_1.Accounts.UpdateAccountSettingUrl, command
                , json => callback(new AccountSettings(json)));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="device"></param>
        /// <param name="includeEntities"></param>
        /// <param name="callback"></param>
        public void UpdateDeliveryDevice(String device, Boolean includeEntities, Action<User> callback)
        {
            var command = new UpdateDeliveryDeviceCommand();
            command.Device = device;
            command.IncludeEntities = includeEntities;
            this.UpdateDeliveryDevice(command, callback);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <param name="callback"></param>
        public void UpdateDeliveryDevice(UpdateDeliveryDeviceCommand command, Action<User> callback)
        {
            this.GetResultText(HttpMethodName.Post, TwitterApiUrl.Version1_1.Accounts.UpdateDeliveryDeviceUrl, command
                , json => callback(new User(json)));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <param name="callback"></param>
        public void UpdateProfile(UpdateProfileCommand command, Action<User> callback)
        {
            this.GetResultText(HttpMethodName.Post, TwitterApiUrl.Version1_1.Accounts.UpdateProfileUrl, command
                , json => callback(new User(json)));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="callback"></param>
        public void UpdateProfileBackgroundImage(Action<User> callback)
        {
            this.UpdateProfileBackgroundImage(null, callback);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <param name="callback"></param>
        public void UpdateProfileBackgroundImage(UpdateProfileBackgroundImageCommand command, Action<User> callback)
        {
            this.GetResultText(HttpMethodName.Post, TwitterApiUrl.Version1_1.Accounts.UpdateProfileBackgroundImageUrl, command
                , json => callback(new User(json)));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="callback"></param>
        public void UpdateProfileBackgroundColors(Action<User> callback)
        {
            this.UpdateProfileBackgroundColors(null, callback);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <param name="callback"></param>
        public void UpdateProfileBackgroundColors(UpdateProfileColorsCommand command, Action<User> callback)
        {
            this.GetResultText(HttpMethodName.Post, TwitterApiUrl.Version1_1.Accounts.UpdateProfileColorsUrl, command
                , json => callback(new User(json)));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="callback"></param>
        public void UpdateProfileImage(Action<User> callback)
        {
            this.UpdateProfileImage(null, callback);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <param name="callback"></param>
        public void UpdateProfileImage(UpdateProfileImageCommand command, Action<User> callback)
        {
            this.GetResultText(HttpMethodName.Post, TwitterApiUrl.Version1_1.Accounts.UpdateProfileImageUrl, command
                , json => callback(new User(json)));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="callback"></param>
        public void RemoveProfileBanner(Action<User> callback)
        {
            this.GetResultText(HttpMethodName.Post, TwitterApiUrl.Version1_1.Accounts.RemoveProfileBannerUrl
                , json => callback(new User(json)));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <param name="callback"></param>
        public void UpdateProfileBanner(UpdateProfileBannerCommand command, Action<User> callback)
        {
            this.GetResultText(HttpMethodName.Post, TwitterApiUrl.Version1_1.Accounts.UpdateProfileBannerUrl, command
                , json => callback(new User(json)));
        }
    }
}
